﻿Imports System.IO

Public Class FileSystemUtilities
    Public Shared ReadOnly Property ExecutableDirectory As String
        Get
            Return System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly.Location())
        End Get
    End Property

    Public Shared ReadOnly Property AppPath As String
        Get
            Return Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
        End Get
    End Property

    Public Shared Sub CheckAndCreateDirectories()
        Dim appdata = FileSystemUtilities.AppPath

        If Not Directory.Exists(appdata & "\ProgettoSicurezza") Then
            Directory.CreateDirectory(appdata & "\ProgettoSicurezza")
        End If
        If Not Directory.Exists(appdata & "\ProgettoSicurezza\users") Then
            Directory.CreateDirectory(appdata & "\ProgettoSicurezza\users")
        End If
    End Sub

 
End Class
